//
//  Emoticon.swift
//  14-表情键盘
//
//  Created by 高伦展 on 2018/2/19.
//  Copyright © 2018年 glz. All rights reserved.
//

import UIKit

/// 表情模型
class Emoticon: NSObject {

    /// 表情文字
    @objc var chs: String?
    /// 表情图片文件名
    @objc var png: String?
    /// 完整路径
    @objc var imagePath:String{
        //是否有图片
        if png == nil{
            return ""
        }
        //拼接完整路径
        return Bundle.main.bundlePath + "/Emoticons.bundle/" + png!
    }
    /// emoji 编码
    @objc var code: String?{
        didSet{
            emoji = code?.emoji
        }
    }
    
    /// emoji 字符串
    @objc var emoji:String?
    
    ///是否删除按钮标记
    @objc var isRemoved = false
    ///是否为空按钮标记
    @objc var isEmpty = false
    
    init(isEmpty:Bool) {
        self.isEmpty = isEmpty
        
        super.init()
    }
    
    init(isRemoved:Bool) {
        self.isRemoved = isRemoved
        
        super.init()
    }
    
    init(dict:[String:AnyObject]) {
        super.init()
        
        setValuesForKeys(dict)
    }
    
    override func setValue(_ value: Any?, forUndefinedKey key: String) {
        
    }
    
    override var description: String{
        let keys = ["chs","png","code","isRemoved"]
        return dictionaryWithValues(forKeys: keys).description
    }
}
